#include <iostream>
#include <string>
#include "../httplib/cpp-httplib-v0.7.15/httplib.h"

using namespace std;
using namespace httplib;

//ojserver要完成：
int main()
{

    Server svr;

    svr.Get("/all_questionslist", [](const Request& req, Response &resp){
        resp.set_content("获取题目列表", "text/plain; charset=utf-8");
    });

    //R"()"
    svr.Get(R"(/one_question/(\d+))", [](const Request& req, Response &resp){
        string num = req.matches[1];
        resp.set_content("获取指定题目" + num, "text/plain; charset=utf-8");
    });

    svr.Get(R"(/judge/(\d+))", [](const Request& req, Response &resp){
        string num = req.matches[1];
        resp.set_content("判定指定题目" + num, "text/plain; charset=utf-8");
    });

    svr.set_base_dir("./wwwroot");
    svr.listen("0.0.0.0", 8080);

    return 0;
}